amends "../snippetTest.pkl"

facts {
  local set: Set<Int> = IntSeq(1, 100).fold(Set(), (res, n) -> res.add(n))
  
  ["local members aren't included in hash code"] {
    local mapping1 = new Mapping { ["one"] = 1 }
    local mapping2 = new Mapping { ["one"] = x; local x = 1 }
    local mapping3 = new Mapping { ["one"] = x; local x = 1 } { ["one"] = y; local y = 1 }
    
    set.add(mapping1).contains(mapping2)
    set.add(mapping2).contains(mapping3)
    set.add(mapping3).contains(mapping2)
    set.add(mapping1).add(mapping2).add(mapping3).length == 101
  }

  ["hidden members aren't included in hash code"] {
    local mapping1 = new Mapping { ["one"] = 1 }
    local mapping2 = new Mapping { ["one"] = 1; default = (_) -> 42 }

    set.add(mapping1).contains(mapping2)
    set.add(mapping2).contains(mapping1)
    set.add(mapping1).add(mapping2).length == 101
  }
}
